import { DataQuery } from '@grafana/schema';
import { SQLOptions } from '@grafana/sql';

// TODO delete
export interface MyQuery extends DataQuery {
  queryText?: string;
  constant: number;
}

// TODO delete
export const DEFAULT_QUERY: Partial<MyQuery> = {
  constant: 6.5,
};

export interface DataPoint {
  Time: number;
  Value: number;
}

export interface DataSourceResponse {
  datapoints: DataPoint[];
}

export enum GaussTLSMethods {
  filePath = 'file-path',
  fileContent = 'file-content',
}

export enum GaussTLSModes {
  disable = 'disable',
  require = 'require',
  verifyCA = 'verify-ca',
  verifyFull = 'verify-full',
}

/**
 * These are options configured for each DataSource instance
 */
export interface GaussOptions extends SQLOptions {
  tlsConfigurationMethod?: GaussTLSMethods;
  sslmode?: GaussTLSModes;
  sslRootCertFile?: string;
  sslCertFile?: string;
  sslKeyFile?: string;
  postgresVersion?: number;
  timescaledb?: boolean;
  enableSecureSocksProxy?: boolean;
}

/**
 * Value that is used in the backend, but never sent over HTTP to the frontend
 */
export interface SecureJsonData {
  apiKey?: string;
  password?: string;
}
